package asedra.huyle.dto;

import android.database.Cursor;

public class Record extends BaseDto{

	public static final String TABLE_NAME = "record";

	public static final String PLAYER_ID = "p_id";

	public static final String MATCH_ID = "m_id";

	public static final String TURN_ORDER = "turn_order";

	public static final String SCORE = "score";

	public static final String[] COLUMNS = new String[]{PLAYER_ID, TURN_ORDER, SCORE};

	public static final String DEFAULT_SORT_ORDER = TURN_ORDER + " ASC";
	
	private int playerId;
	private int matchId;
	private int turnOrder;
	private int score;
	
	public Record(int playerId, int matchId, int turnOrder, int score) {
		super();
		this.playerId = playerId;
		this.matchId = matchId;
		this.turnOrder = turnOrder;
		this.score = score;
	}
	
	public Record(Cursor c) {
		super();
		this.playerId = c.getInt(c.getColumnIndex(PLAYER_ID));
		this.matchId = c.getInt(c.getColumnIndex(MATCH_ID));
		this.turnOrder = c.getInt(c.getColumnIndex(TURN_ORDER));
		this.score = c.getInt(c.getColumnIndex(SCORE));
	}

	public int getPlayerId() {
		return playerId;
	}

	public void setPlayerId(int playerId) {
		this.playerId = playerId;
	}

	public int getMatchId() {
		return matchId;
	}

	public void setMatchId(int matchId) {
		this.matchId = matchId;
	}

	public int getTurnOrder() {
		return turnOrder;
	}

	public void setTurnOrder(int turnOrder) {
		this.turnOrder = turnOrder;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
	
}
